package com.jake.rabbit.demo.producer;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class DirectProducer {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send1(String msg) {
        rabbitTemplate.convertAndSend("jake.direct.exchange", "jake.direct.routingKey.1", msg);
    }

    public void send2(String msg) {
        rabbitTemplate.convertAndSend("jake.direct.exchange", "jake.direct.routingKey.2", msg);
    }

    public void send3(String msg) {
        rabbitTemplate.convertAndSend("jake.direct.exchange", "jake.direct.routingKey.3", msg);
    }
}
